/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: Microsoft
 * Date: 2022-11-23
 * Time: 9:45
 */


class Base {
    //Base是基类的意思
    public int a;
    public int b;
    public int c = 199;

    public void methodBase() {
        System.out.println("Base");
    }
}

class Derived extends Base {
    //派生类
    public int c = 9;

    public void methodDerived() {
        System.out.println("Derived");
    }
    public void methodBase(int a) {
        System.out.println("Derived");
    }
    public void func() {
        super.methodBase();
        methodDerived();
    }

}


public class Test {
    public static void main(String[] args) {
        Derived derived = new Derived();
        derived.func();
    }
}

//public class Test{
//    static int cnt = 6;
//    static{
//        cnt += 9;
//    }
//    public static void main(String[] args){
//        System.out.println("cnt = " + cnt);
//    }
//    static{
//        cnt /=3;
//    }
//}




//        return i;
//    }
//    public static void main(String args[]){
//        Test test = new Test();
//        test.aMethod();
////        int j = test.aMethod();
//        System.out.println(j);
//    }



//class Animal {
//    public String name;
//    public int age;
//
//    public void eat() {
//        System.out.println(name + "正在吃饭");
//    }
//}
//class Dog extends Animal{
//    public void wangwang() {
//        System.out.println(name + "正在叫");
//    }
//}
//
//class Cat extends Animal{
//    public void miaomiao() {
//        System.out.println(name + "正在喵喵叫");
//    }
//}
//public class Test {
//    public static void main(String[] args) {
//        Dog dog = new Dog();
//        dog.name = "坦克";
//        dog.eat();
//        dog.wangwang();
//
//        Cat cat = new Cat();
//        cat.name = "喵咪";
//        cat.eat();
//        cat.miaomiao();
//    }
//}
//



//// Dog.java
//public class Dog{
//    string name;
//    int age;
//    float weight;
//    public void eat(){
//        System.out.println(name + "正在吃饭");
//    }
//    public void sleep(){
//        System.out.println(name + "正在睡觉");
//    }
//    void Bark(){System.out.println(name + "汪汪汪~~~");
//    }
//}
//// Cat.Java
//public class Cat{
//    string name;
//    int age;
//    float weight;
//    public void eat(){
//        System.out.println(name + "正在吃饭");
//    }
//    public void sleep()
//    {
//        System.out.println(name + "正在睡觉");
//    }
//    void mew(){
//        System.out.println(name + "喵喵喵~~~");
//    }
//}














